package com.config;

import io.rsocket.SocketAcceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.codec.CharSequenceEncoder;
import org.springframework.core.codec.StringDecoder;
import org.springframework.messaging.rsocket.RSocketStrategies;
import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler;

@Configuration
public class ConfigForServer {

//    @Bean
//    RSocketMessageHandler messageHandler() {
//        RSocketMessageHandler messageHandler = new RSocketMessageHandler();
//        messageHandler.setRSocketStrategies(RSocketStrategies.builder().encoder(CharSequenceEncoder.textPlainOnly())
//                .decoder(StringDecoder.allMimeTypes()).build());
//        SocketAcceptor responder = messageHandler.responder();
//        return messageHandler;
//    }
}
